package com.wk.mywebview

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.wk.common.autoservice.IWebViewService
import com.wk.webview.utils.AutoServiceUtil.getAutoService
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        initViews()
    }

    private fun initViews() {
        openWeb.setOnClickListener {
            val service = getAutoService(IWebViewService::class.java)
            service?.openWebView(this, "https://www.baidu.com", "百度首页")
        }
    }

}